/**
 * 
 * for SHOW loading PROGRESS...
 * 
 * CONTROLLER for PROGRESS BAR...
 * 
 * 2009-11-9
 * 
 * 
 * */
package com.components.progressbar
{
	import core.section.Controller;
	
	import flash.display.DisplayObject;

	public class ProgressBar extends Controller implements I_ProgressBar
	{
		//START...
		
		
		//PROPERTY...
		private var view:ProgressBarView;
		
		
		//CONSTRUCTOR...
		public function ProgressBar(target:DisplayObject)
		{
		
			super(target);
			
			init();
		
		}
		
		//METHODS...
		
		//initalizing...
		private function init():void
		{
			
			view = new ProgressBarView(target);
			
		}
				
		
		// set progress...
		public function setProgress(total:Number,loaded:Number):void
		{
			
			var percent:Number = loaded / total;
			
			view.progress = percent;
						
		}
		
		//show...
		public function show():void
		{
			
			view.show();
			
		}
				
		//hide...
		public function hide():void
		{
			
			view.hide();
					
		}
		
		
		//END...
	}
}